<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class SecondLevel extends Model
{
    /**
     * 与模型关联的数据表。
     *
     * @var string
     */
    protected $table = 'second_level';
    protected $fillable = ['level', 'first_id', 'name', 'url', 'type', 'weight'];

    public function ThirdLevel()
    {
        return $this->hasMany('App\Model\ThirdLevel', 'second_id', 'id');
    }

    public function FirstLevel()
    {
        return $this->belongsTo('App\Model\FirstLevel', 'first_id', 'id');
    }
}
